﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Department/Master.Master" AutoEventWireup="true" CodeBehind="MakeOrder.aspx.cs" Inherits="logicunivesityinventorystore.Department.MakeOrder" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="ContentPlaceHolder2">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        <h1>Make Order</h1>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Label ID="lblOrderType" runat="server" Text="Order Type:"></asp:Label>
    <asp:DropDownList ID="ddlOrderType" runat="server" AutoPostBack="True" 
        onselectedindexchanged="ddlOrderType_SelectedIndexChanged1">
        <asp:ListItem Selected="True">Simple Order</asp:ListItem>
        <asp:ListItem>Special Order</asp:ListItem>
    </asp:DropDownList>
&nbsp;
    <asp:Label ID="lblExDate" runat="server" Text="Expected Date:"></asp:Label>
    <asp:TextBox ID="txtExDate" runat="server" Height="20px" Width="91px"></asp:TextBox>
    <asp:CalendarExtender ID="cal1" runat="server" 
        Enabled="True" TargetControlID="txtExDate"  Format="dd/MM/yyyy">
    </asp:CalendarExtender>
        <br />
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Label ID="lblCategory" runat="server" Text="Category:"></asp:Label>
&nbsp; 
        <asp:DropDownList ID="ddlCategory" runat="server" 
            DataSourceID="ObjectDataSource1" DataTextField="CategoryName" 
            DataValueField="CategoryID" AutoPostBack="True" 
            >
            <asp:ListItem></asp:ListItem>
        </asp:DropDownList>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            SelectMethod="FindAllCategory" TypeName="BusinessLogicLayer.ItemFacade">
        </asp:ObjectDataSource>
            &nbsp;<asp:Label ID="lblItem" runat="server" Text="Item:"></asp:Label>
            &nbsp;<asp:DropDownList ID="ddlItem" runat="server" Width="119px" 
            AutoPostBack="True" 
        DataSourceID="ObjectDataSource3" DataTextField="Description" 
        DataValueField="ItemCode" Height="16px" 
            >
            <asp:ListItem></asp:ListItem>
        </asp:DropDownList>
        <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
        SelectMethod="FindAllByCategory" TypeName="BusinessLogicLayer.ItemFacade">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlCategory" DefaultValue="" Name="categoryID" 
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
    </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
            SelectMethod="FindAllByCategory" TypeName="BusinessLogicLayer.ItemFacade">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlCategory" Name="categoryID" 
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
&nbsp;<asp:Label ID="lblQty" runat="server" Text="Quantity:"></asp:Label>
    <asp:TextBox ID="txtQty" runat="server"></asp:TextBox>
            <asp:FilteredTextBoxExtender ID="txtQty_FilteredTextBoxExtender" 
        runat="server" Enabled="True" TargetControlID="txtQty" 
        FilterType="Numbers">
    </asp:FilteredTextBoxExtender>
            <asp:NumericUpDownExtender ID="txtQty_NumericUpDownExtender" 
            runat="server" Enabled="True" 
            Minimum="1"  TargetControlID="txtQty" Width="70">
        </asp:NumericUpDownExtender>
        &nbsp;&nbsp;<asp:RegularExpressionValidator 
        ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtQty" 
        ErrorMessage="Invalid Qty!" ValidationExpression="^[1-9]\d*$"></asp:RegularExpressionValidator>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnAdd" 
            runat="server" CssClass="ButtonStyle" 
            Text="Add" Height="24px" Width="56px" onclick="btnAdd_Click" />
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
        <br />
        <center>
        <asp:GridView ID="gvOrderItems" runat="server" AutoGenerateColumns="False" 
                onrowcommand="gdOrderItems_RowCommand">
            <Columns>
                <asp:BoundField HeaderText="Item Code" DataField="ItemCode" />
                <asp:BoundField HeaderText="Category" DataField="Category" />
                <asp:BoundField HeaderText="Item Name" DataField="ItemName" />
                <asp:TemplateField HeaderText="Quantity(Editable)">
                    <ItemTemplate>
                        <asp:TextBox ID="txtQty" runat="server" Height="24px" Width="84px" 
                            Text='<%# Eval("Quantity") %>'></asp:TextBox>
                        <asp:FilteredTextBoxExtender ID="txtQty_FilteredTextBoxExtender" runat="server" 
                            Enabled="True" TargetControlID="txtQty" FilterType="Numbers">
                        </asp:FilteredTextBoxExtender>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Remove">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtnRemove" runat="server" 
                            CommandArgument='<%# Eval("ItemCode") %>' CommandName="Remove">Remove</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        </center>
        &nbsp;
    <br />
    <br />
    <asp:Label ID="lbRemark" runat="server" Text="Remarks:"></asp:Label>
    <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine"></asp:TextBox>
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btnSubmit" runat="server" CssClass="ButtonStyle" 
            Text="Submit" onclick="btnSubmit_Click" />
            <asp:ConfirmButtonExtender ID="btnSubmit_ConfirmButtonExtender" 
        runat="server" ConfirmText="Do you want to proceed?" Enabled="True" TargetControlID="btnSubmit">
    </asp:ConfirmButtonExtender>
            </asp:Content>

<asp:Content ID="Content3" runat="server" 
    contentplaceholderid="ContentPlaceHolder4">
      
                </asp:Content>
<asp:Content ID="Content4" runat="server" 
    contentplaceholderid="ContentPlaceHolder5">
       
                </asp:Content>


